home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
nofusk
/
sample.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-11-25
|
5KB
|
145 lines
{ This is a demonstration how ISREGIST.TPU does work.
Compile and run SAMPLE.PAS program while it is not registered.
then run NOFUSKEY.EXE and register SAMPLE.EXE to your self.
last run SAMPLE.EXE again. (the screens of NoFusKey and Sample
are near the same).
NOTE: the word's written in capital letters are the one you must
include in your source code in order for NoFusKey to work.
}
program sample; {$R-,S-,D-,L-}
uses dos,crt,ISREGIST,graph,bgidriv,bgifont;
var
smallfont, triplexfont, sansserivfont:integer;
col : integer;
i,j,k : longint;
ch : char;
procedure opengraph;
var
grdriver, grmode, errcode :integer;
egavga : integer;
begin
egavga := registerbgidriver(@egavgadriverproc);
smallfont := registerbgifont(@smallfontproc);
triplexfont := registerbgifont(@triplexfontproc);
sansserivfont := registerbgifont(@sansseriffontproc);
grdriver := detect;
initgraph(grdriver, grmode, '');
errcode := graphresult;
IF errcode <> grok then
begin
writeln('Graphics error : ',grapherrormsg(errcode));
writeln('This program does need a ega screen or better.');
writeln('Press >Enter< to Exit');
readln;
closegraph;
halt;
end;
end;
procedure sharewscreen;
begin
cleardevice;
setlinestyle(solidln, 0, thickwidth);
setbkcolor(0);
setcolor(15);
bar(20,20,getmaxx-20,getmaxy-20);
setcolor(10);
rectangle(10,10,getmaxx-10,getmaxy-10);
setviewport(25,25,getmaxx-25,getmaxy-25,CLIPON);
k:=0; col:=0;
for I:=1 to getmaxx-50 DO
begin k:=k+1; for j:=1 to getmaxy-50 DO
begin if k>(getmaxx+80) div 22 then
putpixel(i,j,col+9) else putpixel(i,j,col);
if k=(getmaxx+80) div 19 then begin col:=col+3; k:=0; end;
end;
end;
setcolor(0);
setviewport(0, 0, getmaxx, getmaxy, clipon);
setfillstyle(solidfill,7);
fillellipse(getmaxx div 2, getmaxy div 2, 230, 110);
setcolor(10);
ellipse(getmaxx div 2, getmaxy div 2, 0, 360, 224, 104);
setcolor(4);
ellipse(getmaxx div 2, getmaxy div 2, 0, 360, 214, 94);
setcolor(0);
settextjustify(centertext, centertext);
settextstyle(1, horizdir, 4);
outtextxy((getmaxx div 2)+1 , (getmaxy-39) div 2,'S A M P L E');
settextstyle(1, horizdir, 1);
outtextxy((getmaxx div 2)+1, (getmaxy+40) div 2,'Unregistered Version');
settextstyle(2,horizdir,4);
outtextxy((getmaxx div 2)+1, (getmaxy+99) div 2, 'B y');
settextstyle(1,horizdir,1);
outtextxy((getmaxx div 2)+1, (getmaxy+141) div 2,'G.P.R. DATA');
setcolor(4);
settextjustify(centertext, centertext);
settextstyle(1, horizdir, 4);
outtextxy(getmaxx div 2, (getmaxy-41) div 2,'S A M P L E');
outtextxy((getmaxx div 2)-1, (getmaxy-41) div 2,'S A M P L E');
setcolor(10);
settextstyle(1,horizdir,1);
outtextxy(getmaxx div 2, (getmaxy+140) div 2,'G.P.R. DATA');
setfillstyle(solidfill,0);
setcolor(10);
bar((getmaxx div 2)-105,getmaxy-42,(getmaxx div 2)+105,getmaxy-25);
settextstyle(2,horizdir,5);
while keypressed do ch:=readkey;
outtextxy(getmaxx div 2+2,getmaxy-35,' Press any key to continue: ');
repeat ch:=readkey; until ch> #12;
end;
procedure openscreen;
begin
cleardevice;
setlinestyle(solidln, 0, thickwidth);
setbkcolor(0);
setfillstyle(solidfill,7);
setcolor(15);
bar(20,20,getmaxx-20,getmaxy-20);
setcolor(10);
rectangle(10,10,getmaxx-10,getmaxy-10);
setcolor(0);
settextjustify(centertext, centertext);
settextstyle(1, horizdir, 5);
outtextxy((getmaxx div 2)+4, (getmaxy-174) div 2,'S A M P L E');
settextstyle(2, horizdir, 4);
outtextxy((getmaxx div 2), (getmaxy -80) div 2, 'B y');
settextstyle(1, horizdir, 4);
outtextxy((getmaxx div 2)+3, (getmaxy+221) div 2,'Name');
settextstyle(1, horizdir, 2);
outtextxy(getmaxx div 2, (getmaxy+135) div 2,'Registered to:');
settextstyle(1,horizdir,1);
outtextxy(getmaxx div 2+1, (getmaxy-20 ) div 2,'G.P.R. DATA');
setcolor(10); settextstyle(1,horizdir,1);
outtextxy((getmaxx div 2), (getmaxy-21 ) div 2,'G.P.R. DATA');
setcolor(4);
settextstyle(1, horizdir, 5);
outtextxy((getmaxx div 2)+2, (getmaxy-176) div 2,'S A M P L E');
outtextxy((getmaxx div 2)+3, (getmaxy-176) div 2,'S A M P L E');
setcolor(4); settextstyle(1, horizdir, 4);
outtextxy((getmaxx div 2)+2, (getmaxy+220) div 2,'Name');
setfillstyle(solidfill,0);
setcolor(10);
bar((getmaxx div 2)-105,getmaxy-42,(getmaxx div 2)+105,getmaxy-25);
settextstyle(2,horizdir,5);
while keypressed do ch:=readkey;
outtextxy(getmaxx div 2+2,getmaxy-35,' Press any key to continue: ');
repeat ch:=readkey; until ch> #12;
end;
begin {start of main program}
checkbreak:=false;
REGISTER; {check if it is registered}
opengraph;
if REGISTERED = true then openscreen
else sharewscreen;
closegraph;
clrscr;
checkbreak:=true;
end.